/*
 * Alvin Baldemeca
 * TCSS 305 - Spring 2012
 * Assignment 4 Power Paint
 */

package view.menu;

import javax.swing.Action;
import javax.swing.ButtonGroup;
import javax.swing.JMenu;
import javax.swing.JRadioButtonMenuItem;


/**
 * The class is a JMenu that is used to add to a menu bar. 
 * @author Alvin Baldemeca
 * @version 5/10/2012
 *
 */
@SuppressWarnings("serial")
public class LevelMenu extends JMenu
{
  
  /**
   * The button group to add the radio buttons to.
   */
  private final ButtonGroup my_group = new ButtonGroup();
  
  /**
   * Constructs a JMenu with the name Thickness and Mnemonic 'T'.
   */
  public LevelMenu()
  {
    super("Select Level");
    setMnemonic('L');   
  }
  
  /**
   * Creates a radio button for the tool menu.
   * @param an_action the action to attach to the button
   */
  public void createRadioButton(final Action an_action) 
  {
    final JRadioButtonMenuItem button = new JRadioButtonMenuItem(an_action);
    my_group.add(button);
    add(button);
  }
  
}
